﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.sysadmin.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.sysadmin.dao.*;
import com.hh.bss.sysadmin.entity.*;
import com.hh.bss.sysadmin.service.*;
import com.hh.bss.sysadmin.vo.query.*;
import com.hh.bss.util.*;





public class SystemAuditLog extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SystemAuditLog";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_LOG_DT = "logDt";
	public static final String ALIAS_ACCOUNT = "account";
	public static final String ALIAS_MODULE_NBR = "moduleNbr";
	public static final String ALIAS_RESOURCE_ID = "resourceId";
	public static final String ALIAS_DML_TYPE = "dmlType";
	public static final String ALIAS_ORIGINAL_DATA = "originalData";
	
	//date formats
	public static final String FORMAT_LOG_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.util.Date logDt;
	@NotBlank @Length(max=50)
	private java.lang.String account;
	@Length(max=10)
	private java.lang.String moduleNbr;
	
	private java.lang.Integer resourceId;
	@Length(max=1)
	private java.lang.String dmlType;
	@Length(max=2147483647)
	private java.lang.String originalData;
	//columns END

	public SystemAuditLog(){
	}

	public SystemAuditLog(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public String getLogDtString() {
		return DateConvertUtils.format(getLogDt(), FORMAT_LOG_DT);
	}
	public void setLogDtString(String value) {
		setLogDt(DateConvertUtils.parse(value, FORMAT_LOG_DT,java.util.Date.class));
	}
	
	public void setLogDt(java.util.Date value) {
		this.logDt = value;
	}
	
	public java.util.Date getLogDt() {
		return this.logDt;
	}
	public void setAccount(java.lang.String value) {
		this.account = value;
	}
	
	public java.lang.String getAccount() {
		return this.account;
	}
	public void setModuleNbr(java.lang.String value) {
		this.moduleNbr = value;
	}
	
	public java.lang.String getModuleNbr() {
		return this.moduleNbr;
	}
	public void setResourceId(java.lang.Integer value) {
		this.resourceId = value;
	}
	
	public java.lang.Integer getResourceId() {
		return this.resourceId;
	}
	public void setDmlType(java.lang.String value) {
		this.dmlType = value;
	}
	
	public java.lang.String getDmlType() {
		return this.dmlType;
	}
	public void setOriginalData(java.lang.String value) {
		this.originalData = value;
	}
	
	public java.lang.String getOriginalData() {
		return this.originalData;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("LogDt",getLogDt())
			.append("Account",getAccount())
			.append("ModuleNbr",getModuleNbr())
			.append("ResourceId",getResourceId())
			.append("DmlType",getDmlType())
			.append("OriginalData",getOriginalData())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SystemAuditLog == false) return false;
		if(this == obj) return true;
		SystemAuditLog other = (SystemAuditLog)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

